package com.toivan.mt.model;

import java.util.Iterator;
import java.util.List;

/**
 * @ClassName MtPortraitManager
 * @Description TODO
 * @Author Spica2 7
 * @Date 2021/6/22 15:16
 */
@SuppressWarnings("unused")
public class MtPortraitManager {

    private List<MtPortrait> portraits;

    public List<MtPortrait> getPortraits() {
        return portraits;
    }


    public MtPortrait findPortrait(String name) {
        Iterator iterator = this.portraits.iterator();
        MtPortrait mtPortrait;

        do {
            if (!iterator.hasNext()) {
                return null;
            }
        } while (!name.equals((mtPortrait = (MtPortrait) iterator.next()).getName()));

        return mtPortrait;

    }


    public void setPortraits(List<MtPortrait> portraits) {
        this.portraits = portraits;
    }
}
